#ifndef DWGOBJECT_H
#define DWGOBJECT_H

#include <QObject>
#include <QColor>
#include <QPainter>
enum DrawType			// 该枚举类型用于区别正在绘制的图元的类型
{
    None,
    DPoint,
    DLine,
    DCircle,
    DRectangle,
    DArc,
    DPLine,
    DSpline
};
class DwgObject : public QObject
{
    Q_OBJECT
public:
    explicit DwgObject(QObject *parent = nullptr);
    virtual ~DwgObject() {};

    virtual void Draw(QPainter * painter) = 0;				// 纯虚函数不需要在基类中实现
    // virtual void SetData(QPoint pt1,QPoint pt2) = 0;

    DrawType mType = None;		// 用来记录图元类型的枚举变量，只能是枚举值之一，初始化为空None

    // // 线宽、线颜色访问器函数
    // int getLineWidth() const { return mLineWidth; }
    // QColor getLineColor() const { return mLineColor; }

    // // 线宽、线颜色修改器函数
    // void setLineWidth(int width) { mLineWidth = width; }
    // void setLineColor(const QColor& color) { mLineColor = color; }

private:
    int mLineWidth = 0;
    QColor mLineColor = Qt::black;

signals:
};

#endif // DWGOBJECT_H
